//
//  NoThingShopView.m
//  HuiPinzhijia
//
//  Created by MS on 16/8/31.
//  Copyright © 2016年 LLMPro. All rights reserved.
//

#import "NoThingShopView.h"

@implementation NoThingShopView

{
    UIView *_myView;
}
static NoThingShopView *_sharedNothingView;

+ (NoThingShopView *)sharedNoThingView
{
    if (!_sharedNothingView)
    {
        _sharedNothingView = [[NoThingShopView alloc]init];
    }
    return _sharedNothingView;
}

- (void)updateNothingView
{

     _myView = [[UIView alloc]initWithFrame:self.frame];
    [self addSubview:_myView];
   
    [self initMyView];
    
}

- (void)initMyView
{
   
    UIImageView *shopImageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.frame.size.width/2 - 64, 128, 128, 128)];
    shopImageView.image = [UIImage imageNamed:@"gouwuche"];
    [_myView addSubview:shopImageView];
    
    UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(0, shopImageView.frame.size.height + 40 + shopImageView.frame.origin.y, self.frame.size.width, 40)];
    lable.text = @"购物车什么都没有,快点去购物吧";
    lable.textAlignment = NSTextAlignmentCenter;
    [_myView addSubview:lable];
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(self.frame.size.width/2 - 70, lable.frame.size.height + lable.frame.origin.y + 20, 140, 40)];
    btn.backgroundColor = [UIColor blueColor];
    [btn setTitle:@"去购物" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(noThingBtnC) forControlEvents:UIControlEventTouchUpInside];
    [_myView addSubview:btn];
    
}

- (void)noThingBtnC
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(noThingBtnClick)])
    {
        [self.delegate noThingBtnClick];
    }
}


@end











